package ace.module.stock.api.model.dto;

import io.swagger.v3.oas.annotations.media.Schema;

import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import jakarta.validation.constraints.*;
import jakarta.annotation.Nullable;
import java.io.Serializable;

/**
* 销量变更记录,保存90天 data transform object.
*
* @author Caspar
*/
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Schema(title = WmsSalesQuantityRecordDto.TABLE_DESC)
public class WmsSalesQuantityRecordDto implements Serializable {

  public static final String TABLE_NAME = "wms_sales_quantity_record";
  public static final String TABLE_DESC = "销量变更记录,保存90天";
  public static final String ID_COLUMN_NAME = "id";
  public static final String ID_TITLE = "id";
  public static final String ID_DESC = "";
  public static final String WMS_APP_ID_COLUMN_NAME = "wms_app_id";
  public static final String WMS_APP_ID_TITLE = "商品应用id";
  public static final String WMS_APP_ID_DESC = "0=null";
  public static final String SALES_QUANTITY_ID_COLUMN_NAME = "sales_quantity_id";
  public static final String SALES_QUANTITY_ID_TITLE = "销量id";
  public static final String SALES_QUANTITY_ID_DESC = "0=null";
  public static final String BATCH_SN_COLUMN_NAME = "batch_sn";
  public static final String BATCH_SN_TITLE = "批次流水号";
  public static final String BATCH_SN_DESC = "";
  public static final String REVERSE_FLAG_COLUMN_NAME = "reverse_flag";
  public static final String REVERSE_FLAG_TITLE = "还原操作标志";
  public static final String REVERSE_FLAG_DESC = " 0-没有还原 1-还原";
  public static final String REVERSE_ID_COLUMN_NAME = "reverse_id";
  public static final String REVERSE_ID_TITLE = "还原记录id,还原记录id或被还原记录id";
  public static final String REVERSE_ID_DESC = "0=null";
  public static final String ACTION_TYPE_COLUMN_NAME = "action_type";
  public static final String ACTION_TYPE_TITLE = "操作类型,只有ADD与SUBTRACT操作支持还原操作";
  public static final String ACTION_TYPE_DESC = " 1-设置 200-增加 300-减少";
  public static final String QUANTITY_COLUMN_NAME = "quantity";
  public static final String QUANTITY_TITLE = "数量";
  public static final String QUANTITY_DESC = "根据actionType进行增减设置操作,仅支持正数;actionType=SET,支持正负数";
  public static final String REMARK_COLUMN_NAME = "remark";
  public static final String REMARK_TITLE = "备注";
  public static final String REMARK_DESC = "";
  public static final String DELETE_FLAG_COLUMN_NAME = "delete_flag";
  public static final String DELETE_FLAG_TITLE = "删除标识";
  public static final String DELETE_FLAG_DESC = "0-未删除";
  public static final String CREATE_TIME_COLUMN_NAME = "create_time";
  public static final String CREATE_TIME_TITLE = "创建时间";
  public static final String CREATE_TIME_DESC = "单位-毫秒";
  public static final String UPDATE_TIME_COLUMN_NAME = "update_time";
  public static final String UPDATE_TIME_TITLE = "更新时间";
  public static final String UPDATE_TIME_DESC = "单位-毫秒";
  public static final String ROW_VERSION_COLUMN_NAME = "row_version";
  public static final String ROW_VERSION_TITLE = "版本号和乐观锁";
  public static final String ROW_VERSION_DESC = "";

  @Schema(title = ID_TITLE, description = ID_DESC)
  private Long id;

  @Schema(title = WMS_APP_ID_TITLE, description = WMS_APP_ID_DESC)
  private Long wmsAppId;

  @Schema(title = SALES_QUANTITY_ID_TITLE, description = SALES_QUANTITY_ID_DESC)
  private Long salesQuantityId;

  @Size(max = 255)
  @Schema(title = BATCH_SN_TITLE, description = BATCH_SN_DESC)
  private String batchSn;

  @Schema(title = REVERSE_FLAG_TITLE, description = REVERSE_FLAG_DESC)
  private Integer reverseFlag;

  @Schema(title = REVERSE_ID_TITLE, description = REVERSE_ID_DESC)
  private Long reverseId;

  @Schema(title = ACTION_TYPE_TITLE, description = ACTION_TYPE_DESC)
  private Integer actionType;

  @Schema(title = QUANTITY_TITLE, description = QUANTITY_DESC)
  private Long quantity;

  @Size(max = 255)
  @Schema(title = REMARK_TITLE, description = REMARK_DESC)
  private String remark;

  @Schema(title = DELETE_FLAG_TITLE, description = DELETE_FLAG_DESC)
  private Long deleteFlag;

  @Schema(title = CREATE_TIME_TITLE, description = CREATE_TIME_DESC)
  private Long createTime;

  @Schema(title = UPDATE_TIME_TITLE, description = UPDATE_TIME_DESC)
  private Long updateTime;

  @Schema(title = ROW_VERSION_TITLE, description = ROW_VERSION_DESC)
  private Long rowVersion;

}